/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.src.uniandes.ecos.tsp.creditscore.helper;

import com.src.uniandes.ecos.tsp.creditscore.entity.Cliente;
import com.src.uniandes.ecos.tsp.creditscore.exception.CreditScoreException;
import com.src.uniandes.ecos.tsp.creditscore.jpa.ClienteJpaController;
import java.util.List;

/**
 *
 * @author AndhyMao
 */
public class CreditScoreHelper {

    protected static CreditScoreHelper creditScoreHelper;

    public static CreditScoreHelper getInstance() {
        if (creditScoreHelper == null) {
            creditScoreHelper = new CreditScoreHelper();
        }
        return creditScoreHelper;
    }

    public List<Cliente> findClienteEntities() throws CreditScoreException {
        List<Cliente> listClientes = null;
        try {
            ClienteJpaController clienteJpaController = new ClienteJpaController();
            listClientes = clienteJpaController.findClienteEntities();
        }
        catch (Exception e) {
            throw new CreditScoreException("CreditScoreHelper:findClienteEntities:" + e.toString());
        }
        return listClientes;
    }
}
